#include"resource.h"
#include<Windows.h>
HBRUSH g_hBackground=NULL;
BOOL CALLBACK DlgProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
	switch(msg)
	{
	case WM_INITDIALOG:
		g_hBackground=CreateSolidBrush(RGB(0,0,0));
		break;
	case WM_CTLCOLORDLG:
		return (LONG)g_hBackground;
	case WM_CTLCOLORSTATIC:
		{
			HDC hdcStatic=(HDC)wParam;
			SetTextColor(hdcStatic,RGB(255,255,255));
			SetBkMode(hdcStatic,TRANSPARENT);
			return (LONG)g_hBackground;
		}
		break;
	case WM_COMMAND:
		{
			switch (LOWORD(wParam))
			{
			case IDOK:
				EndDialog(hwnd,0);
				break;
			}
		}
		break;
	case WM_CLOSE:
		EndDialog(hwnd,0);
		break;
	case WM_DESTROY:
		DeleteObject(g_hBackground);
	default:
		return FALSE;
	}
	return TRUE;
}

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdLine)
{
	return DialogBox(hInstance,MAKEINTRESOURCE(IDD_MAIN),NULL,DlgProc);
}
